<ion-header>
  <ion-toolbar color="primary">
    <ion-navbar>
      <ion-row>
        <ion-title>缓存信息</ion-title>
        <div (click)="goOnline()" ion-button color="light" clear>
          <ion-icon name="log-in"></ion-icon>&nbsp;
          切换到在线功能
        </div>
      </ion-row>
    </ion-navbar>
  </ion-toolbar>
</ion-header>

<ion-content>
  <ion-card [hidden]="userInfoTag">
    <ion-card-header>
      登录确定用户
    </ion-card-header>
    <ion-card-content>
      <ion-list>
        <ion-item>
          <ion-input type="text" placeholder="用户名" [(ngModel)]="userName"></ion-input>
        </ion-item>

        <ion-item>
          <ion-input type="password" placeholder="密码" [(ngModel)]="pwd"></ion-input>
        </ion-item>
      </ion-list>

      <ion-row>
        <ion-col col-6>
          <button ion-button full (click)="doLogin()" id="dologin">
            <ion-icon name="log-in"></ion-icon>&nbsp;
            登录
          </button>
        </ion-col>
        <ion-col col-6>
          <button ion-button full (click)="scanLogin()">
            <ion-icon name="barcode"></ion-icon>&nbsp;
            扫码登录
          </button>
        </ion-col>
      </ion-row>
    </ion-card-content>
  </ion-card>

  <ion-card [hidden]="!userInfoTag">
    <ion-card-content>
      <ion-card-title>
        用户信息
      </ion-card-title>
      <ion-row>
        <ion-col col-6 text-left>
          <h5>用户名:</h5>
        </ion-col>
        <ion-col col-6 text-right>
          <h5>{{user.name}}</h5>
        </ion-col>
      </ion-row>
      <ion-row>
        <ion-col col-6 text-left>
          <h5>所属公司:</h5>
        </ion-col>
        <ion-col col-6 text-right>
          <h5>{{user.company}}</h5>
        </ion-col>
      </ion-row>
      <button ion-button full clear (click)="switchUser()">切换用户</button>
    </ion-card-content>
  </ion-card>

</ion-content>


<ion-footer>
  <ion-row>
    <ion-col col-6>
      <button ion-button full  [disabled]="cacheBtnTag"  (click)="refreshCache()">
        更新缓存
      </button>
    </ion-col>
    <ion-col col-6>
      <button ion-button full color="light" (click)="goBack()">返回</button>
    </ion-col>
  </ion-row>
</ion-footer>